# Maintainer: Patrick Gansterer <paroga@paroga.com>
pkgname=mdbook-plantuml
pkgver=0.8.0
pkgrel=0
pkgdesc="Preprocessor for mdbook to render PlantUML diagrams"
url="https://github.com/sytsereitsma/mdbook-plantuml"
arch="all"
license="MIT"
depends="mdbook"
makedepends="cargo cargo-auditable openssl-dev"
source="https://github.com/sytsereitsma/mdbook-plantuml/archive/refs/tags/v$pkgver/mdbook-plantuml-$pkgver.tar.gz
	cargo-lock.patch
	update-libc-for-loongarch64.patch
	"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

check() {
	cargo test --frozen
}

package() {
	install -D -m755 target/release/$pkgname -t "$pkgdir"/usr/bin/
}

sha512sums="
2add4b0f0ee3f46e7d37f4c9ed62ebc2f26caf1aae2c9d226da7b06581cc0837bf1a0a8b0a1094c4c49bad418790b75a3ff4d65e4ac2601fd0baa51d52a59642  mdbook-plantuml-0.8.0.tar.gz
eda737513f0f76b21dd7cb4e4e790ec3e46d08410ad2434a8def93bd0dba06daa15e2c837dfa68e1d9287d6c77cced2ad45a871f9e70ee1a5021aac94873c0b4  cargo-lock.patch
bbd0c6bd0b48cf06a459e4d058741d347eacf23597bdf0ea073456c30f6e4a9f985b1655a07cc8f884aedd5fb10e5d1e86f0c7d11c5a75d5e174314576f8613b  update-libc-for-loongarch64.patch
"
